$(function(){
	dormInit();
	$(".form-submit").click(function(){
		var state = $("[name='state']").val();
		var money = $("[name='money']").val();
		var content = $("[name='content']").val();
		var page = $("[name='pageNo']").val();
		$.ajax(
			{
				url:"cadre/addFee.do",
				type:"post",
				data:{
					details:content,
					classFeeState:state,
					money:money,
					pageNo:page
				},
				success:function(result){
					var i = data.indexOf("forword:");
					if (i != -1) {//根据返回值进行跳转
						var url = data.substring("forword:".length);
						window.location.href = "/TMS"+url;
						return;
				    }
					alert(result);
				},
				error:function(error){
					alert(result);
				}
			}
		);
	});
});

function dormInit(){
	var date = new Date();
	var year = date.getFullYear();
	var month = date.getMonth() + 1;
	year = year.toString();
	year = year.substr(2) + "年";
	var period = "";
	if(month>=3 && month<=8)
		period = "春季";
	else if(month>=9 && month<=12) period = "秋季";
	$("[name='period']").val(year+period);
	$("[name='month']").val(month);
}


